<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="style/css.css"/>
<script src="JavaScript/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<title>登录</title>
</head>
<body>
<div class="login_box">
 <form id="from1">
   <table>
     <tr><th colspan="2" >登录界面</th></tr>
     <tr><td width="50px" align="right" >用户名</td><td align="left"><input type="text" name="name"/></td></tr>
     <tr><td width="50px" align="right">密码</td><td align="left"><input type="password" name="password"/></td></tr>     
   	 <tr><td colspan="2" ><input type="button" value="登录" id="login"/></td></tr>
   </table>
   </form>
   </div>
   <script type="text/javascript">
   	$("#login").click(function () {
   		$.ajax({
   			type:"post",
   			url:"loginServelt",
   			data:$("#from1").serialize(),
   			success:function(data){
   				if(data.flag){
   					location.href="view/1";
   				}else{
   					alert("登录失败！");
   				}   			}
   		});
   	});
   </script>
</body>
</html>